package com.example.redis.config;

import com.example.redis.exception.IdempotentException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalException {

    @ExceptionHandler(IdempotentException.class)
    public String IdempotentException(IdempotentException e){
        System.out.println("message:" + e.getMessage()) ;
        e.printStackTrace();
        return e.getMessage();
    }
}
